increment laravel

48

laravel add auto increment -

Schema::table('item_tag', function (Blueprint $table) {
    $table->increments('id')->first();
});

increment laravel -

$customer = Customer::find($customer_id);
$loyalty_points = $customer->loyalty_points + 1;
$customer->update(['loyalty_points' => $loyalty_points]);

or

Customer::find($customer_id)->increment('loyalty_points');

Comments

Submit
0 Comments